/*************************************************************************
> File Name: pre_01.cpp
> Author: hzy
> Created Time: 2023-08-19 14:27:00
> Description:
************************************************************************/
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

// bool HCompare(int num)
// {
//     return num > 5;
// }

class HCompare
{
public:
    bool operator()(int num)
    {
        return num > 12;
    }
};

void test1()
{
    int arr[] = {1, 2, 5, 4, 9, 7, 6, 12, 13};
    int arr_len = sizeof(arr) / sizeof(arr[0]);

    vector<int> v(arr, arr + arr_len);

    vector<int>::iterator it = find_if(v.begin(), v.end(), HCompare());
    if (it == v.end())
    {
        cout << "没有找到" << endl;
    }
    else
    {
        cout << "找到了 " << *it << endl;
    }

    // for (int i = 0; i < arr_len; i++)
    // {
    //     show(arr[i]);
    // }
    // cout << endl;
}

int main()
{
    test1();

    return 0;
}